﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Media.Imaging;

namespace MolfMolfMolf
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            initNaviation();

            CoursesNavigation.Tap +=new EventHandler<GestureEventArgs>(CoursesNavigation_Tap);
            NewsNavigation.Tap += new EventHandler<GestureEventArgs>(NewsNavigation_Tap);
        }

        void NewsNavigation_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/NewsPage.xaml", UriKind.Relative));
        }

        void CoursesNavigation_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/LocationSelection.xaml", UriKind.Relative));
        }

        private void initNaviation()
        {
            Uri uri_course = new Uri("Images/golf.png", UriKind.Relative);
            CoursesNavigation.ImgSource = new BitmapImage(uri_course);
            CoursesNavigation.SetNavigationTitle("Courses");
            CoursesNavigation.SetNavigationDes("Find Specific Course");
            
            Uri uri_news = new Uri("Images/rss.png", UriKind.Relative);
            NewsNavigation.ImgSource = new BitmapImage(uri_news);
            NewsNavigation.SetNavigationTitle("News");
            NewsNavigation.SetNavigationDes("Hottest News");
            
            Uri uri_setting = new Uri("Images/setting.png", UriKind.Relative);
            SettingNavigation.ImgSource = new BitmapImage(uri_setting);
            SettingNavigation.SetNavigationTitle("Settings");
            SettingNavigation.SetNavigationDes("Configure your setting");
        }
    }
}
